package utils;

import org.apache.log4j.Logger;
import org.testng.Reporter;

/**
 * Created by Mikhail.Chub on 29/05/2014.
 */
public class Log4Test {

    private static final Logger LOGGER = Logger.getLogger(Log4Test.class);

    private static final String INFO_MESSAGE = "INFO: %s .";
    private static final String ERROR_MESSAGE = "ERROR: %s !!!";

    private Log4Test () {
    }

    public static String info (String message) {
        LOGGER.info(String.format(INFO_MESSAGE, message));
        Reporter.log(String.format(INFO_MESSAGE, message));
        return String.format(INFO_MESSAGE, message);
    }

    public static String error (String message) {
        LOGGER.error(String.format(ERROR_MESSAGE, message));
        Reporter.log(String.format(ERROR_MESSAGE, message));
        return String.format(ERROR_MESSAGE, message);
    }

}
